# -*- coding: utf-8 -*-
from alipay import AliPay

import os

path = os.path.dirname(__file__)
private_key_path = os.path.join(path, 'private_key.txt')
public_key_path = os.path.join(path, 'alipay_pub.txt')


def alipay_init():
    alipay = AliPay(
        appid="2016080600183748",
        app_notify_url="http://121.40.183.170:5005/zzh/app/v2/checkNotify",
        app_private_key_path=private_key_path,
        alipay_public_key_path=public_key_path,
        # 支付宝的公钥，验证支付宝回传消息使用，不是你自己的公钥,
        sign_type="RSA2",  # RSA 或者 RSA2
        debug=False  # 默认False
    )
    return alipay